import request from '@/utils/request';
import { AxiosPromise } from 'axios';
import { UserLevelExperienceLogVO, UserLevelExperienceLogForm, UserLevelExperienceLogQuery } from '@/api/business/userLevelExperienceLog/types';

/**
 * 查询用户等级经验变动记录列表
 * @param query
 * @returns {*}
 */

export const listUserLevelExperienceLog = (query?: UserLevelExperienceLogQuery): AxiosPromise<UserLevelExperienceLogVO[]> => {
  return request({
    url: '/business/userLevelExperienceLog/list',
    method: 'get',
    params: query
  });
};

/**
 * 查询用户等级经验变动记录详细
 * @param id
 */
export const getUserLevelExperienceLog = (id: string | number): AxiosPromise<UserLevelExperienceLogVO> => {
  return request({
    url: '/business/userLevelExperienceLog/' + id,
    method: 'get'
  });
};

/**
 * 新增用户等级经验变动记录
 * @param data
 */
export const addUserLevelExperienceLog = (data: UserLevelExperienceLogForm) => {
  return request({
    url: '/business/userLevelExperienceLog',
    method: 'post',
    data: data
  });
};

/**
 * 修改用户等级经验变动记录
 * @param data
 */
export const updateUserLevelExperienceLog = (data: UserLevelExperienceLogForm) => {
  return request({
    url: '/business/userLevelExperienceLog',
    method: 'put',
    data: data
  });
};

/**
 * 删除用户等级经验变动记录
 * @param id
 */
export const delUserLevelExperienceLog = (id: string | number | Array<string | number>) => {
  return request({
    url: '/business/userLevelExperienceLog/' + id,
    method: 'delete'
  });
};
